/*
 * @Author: 李天惊 uf_lee@163.com
 * @Date: 2022-10-11 13:32:23
 * @LastEditors: 李天惊 uf_lee@163.com
 * @LastEditTime: 2022-11-16 17:02:28
 * @FilePath: \grazlink20\uc_sys\src\api\cs\income\index.ts
 * Copyright (c) 2022 by 李天惊 uf_lee@163.com, All Rights Reserved.
 */
import { useAxios } from '@/hooks/web/useAxios'
import type { TableData } from './types'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 入款单列表
export const adminCsIncomeListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeList',
      data: data
    }
  })
}

// 入款单查看
export const adminCsIncomeSeeApi = (data: { income_id: string }) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeSee',
      data: data
    }
  })
}

// 入款单修改
export const adminCsIncomeEditApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeEdit',
      data: data
    }
  })
}

// 入款单新增
export const adminCsIncomeAddApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeAdd',
      data: data
    }
  })
}

// 入款单删除
export const adminCsIncomeDelApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeDel',
      data: data
    }
  })
}

// 入款单批量删除
export const adminCsIncomeBatchDelApi = (data: { ids: string }) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeBatchDel',
      data: data
    }
  })
}

// 入款单修改状态
export const adminCsIncomeEditStatusApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsIncomeEditStatus',
      data: data
    }
  })
}
